Hi Tom,
Several times in the past I've had mechanical issues, (broken cutters, etc..) that caused me to want to start a multi operation GCode somewhere in the middle. I would typically edit the file, then re-save as a delme.nc or such. I never made use of the Block Delete option because it was too cumbersome to add all of the '/' tags at the start of the line.
What I added was code to toggle the line '/' prefix of all selected lines. I added the appropriate code to include the option in the pop up context menu as well. I know that the "Set Next Statement" option could be used, but it doesn't usually work if you are trying to skip over several arc commands.
ERic
void CRichEditCtrlEx::OnToggleBlock()
{
CString s = GetSelText();
if (s.GetLength() == 0)
{
AfxMessageBox("Nothing Selected to Toggle");
return;
}
int oldStart = 0;
int newLine = -1;
while((newLine = s.Find("\n", newLine+1)) != -1)
{
if(s.GetAt(oldStart) == '/')
{
s.Delete(oldStart,1);
}
else
{
s.Insert(oldStart==0?oldStart:oldStart+1, '/');
newLine++;
}
oldStart = newLine;
}
ReplaceSel(s);
}